#include "StdAfx.h"
#include "Project.h"
#include "tinyxml/tinyxml2.h"

CProject::CProject(void)
{
}


CProject::~CProject(void)
{
}

BOOL CProject::Load( LPCTSTR prjfile )
{
	tinyxml2::XMLDocument doc;
	if(tinyxml2::XML_NO_ERROR != doc.LoadFile(CT2CA(prjfile)))
		return FALSE;

	const char* v;
	tinyxml2::XMLElement* node;

	tinyxml2::XMLElement* root = doc.RootElement();
	ASSERT(root);
	
	v = root->Attribute("name");
	if(!v)	return FALSE;
	m_strName = v;

	node = root->FirstChildElement("datapath");
	if(!node)	return FALSE;
	m_strDataPath = node->GetText();

	return TRUE;
}

BOOL CProject::Open( LPCTSTR prjfile )
{
	return Load(prjfile);
}

void CProject::Close()
{
	// do nothing currrently!
}
